import { selectListProduct } from '@/api/basicData/product/product.js'

export const ProductSelect1 = {
  data() {
    return {
      ProductTableKeys1: [
        {
          width: 200,
          key: 'productName',
          title: '产品名称'
        },
        {
          width: 200,
          key: 'specifications',
          title: '规格型号'
        },
        {
          width: 200,
          key: 'customerModel',
          title: '客户型号'
        },
        {
          width: 200,
          key: 'cartonSize',
          title: '外箱尺寸'
        },
        {
          width: 200,
          key: 'productCategory',
          title: '产品分类'
        },
        {
          width: 200,
          key: 'basicUnit',
          title: '基本单位'
        }
      ]
    }
  },
  methods: {
    /*    弹窗组件自定义事件    */
    getlistProduct1({ pageNum, pageSize, keyWord }) {
      // 查询列表
      selectListProduct({
        pageNum, pageSize, keyWord
      }).then(resp => {
        let productList = resp.rows || []
        let total = resp.total
        // 数据回传
        this.$refs.ProductSelect1.receive(productList, total)
      })
    },
    updateQueryParamsForProduct1(productId) {
      this.form.productId = productId
    },
    selectDialogItemForProduct1({ productName }) {
      this.$refs.ProductSelect1.formItemKeyWord = productName
    }
  }
}

